package meiRiYiTi;

/**
 * Author: 笨蛋超人不会飞
 * Date:  9:51
 */
public class day_2960 {
    public int countTestedDevices(int[] batteryPercentages) {
//        通过简单的一次遍历就可以了
        int result=0;
        int sum=0;
        for (int i = 0; i < batteryPercentages.length; i++) {
            if(batteryPercentages[i]>sum){
                result++;
                sum++;
            }
        }
        return result;

    }
}
